package cn.bluedot.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.bluedot.bean.PageBean;
import cn.bluedot.dao.PigDao;
import cn.bluedot.model.Pig;
import cn.bluedot.service.PigService;
import cn.bluedot.util.PageBeanFactory;

@Service
public class PigServiceImpl implements PigService{
    @Resource
    private PigDao pigDao;

    @Override
    public PageBean<Pig> getPigs(String page, Long pigType, Long pigGrowth) {
        //从工厂中创建一个对应的页面设置PageBean
        PageBean<Pig> pb = PageBeanFactory.getPageBean(page, 5);
        
        pb.setTableData(pigDao.getPigs(pb, pigType, pigGrowth));
        
        return pb;
    }
    
}
